﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Driver;

namespace MongoServices
{
	internal sealed class RepositoryConfigContainer<TRepo, TModel>
		where TRepo : MongoServicesRepository<TModel>
		where TModel: MongoServicesModel
	{
		#region Nested Singleton
		class Nested
		{
			// Explicit static constructor to tell C# compiler
			// not to mark type as beforefieldinit
			static Nested()
			{
			}

			internal static readonly RepositoryConfigContainer<TRepo, TModel> instance = new RepositoryConfigContainer<TRepo, TModel>();
		}

		public static RepositoryConfigContainer<TRepo, TModel> Instance
		{
			get
			{
				return Nested.instance;
			}
		}
		#endregion

		#region MongoUrlProvider
		public Func<MongoUrl> MongoUrlProvider { get; set; }
		#endregion
	}
}
